package com.zxs.xss.util;


import org.jsoup.Jsoup;
import org.jsoup.safety.Safelist;

public final class HtmlFilterKit implements CharacterFilter {
	public static Safelist safelist;

	private static final String NEWLINE_REGEX = "\n";
	@Override
	public String filter(String input) {
		if (input == null || input.trim().isEmpty()) {
			return input;
		}
		return Jsoup.clean(input, safelist).replaceAll(NEWLINE_REGEX, "");
	}
}
